package behavior.commend;

public class Test {
    public static void main(String[] args) {

        //遥控器
        RemoteController remoteController = new RemoteController();

        //灯
        LightReceiver lightReceiver = new LightReceiver();

        Command lightOffCommand = new LightOffCommand(lightReceiver);
        Command lightOnCommand = new LightOnCommand(lightReceiver);

        //设置化命令
        remoteController.setCommand(0,lightOnCommand,lightOffCommand);

        //开
        remoteController.pressOn(0);
        remoteController.pressUndo();

    }
}
